<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
//会员管理
class Membership extends Controller
{
    //账户管理
    public function user_list()
    {
        
        //查询数据库
        $res = Db::name('housedetails')->paginate(3);
        $this->assign("data",$res);
        return $this->fetch('user_list');
    }
    //支付方式
    public function member_grading()
    {
        return $this->fetch();
    }
    //支付配置
    public function integration()
    {
        return $this->fetch();
    }
    //添加房屋信息
    public function addhouse(){
        $a1=$_POST['a1'];
        $a2=$_POST['a2'];
        $a3=$_POST['a3'];
        $a5=$_POST['a5'];
        $a6=$_POST['a6'];
        $a7=$_POST['a7'];
        $a8=$_POST['a8'];
        $a9=$_POST['a9'];
        $a10=$_POST['a10'];
        $a11=$_POST['a11'];
        $a12=$_POST['a12'];
        $a13=$_POST['a13'];
      
        $data= array('house_size'=>$a1,
            'house_name'=>$a2,
            'house_des'=>$a3,
            'house_type'=>$a5,
           'house_price'=>$a7,
            'house_direction'=>$a8,
            'house_wintype'=>$a9,
           'house_time'=>$a10,
            'house_state'=>$a6,
            'house_te'=>$a11,
            'house_lontiude'=>$a12,
            'house_latiude'=>$a13,
            'house_setmen'=>'0'
        );
        $res=Db::name('housedetails')->insertGetId($data);
        if($res){
            $raw_success = array( 'msg' => 'ok','id'=>$res);
            return json($raw_success);
        }
        else {
            
        }
        
    }
 }